package cn.skyclass.beans
{
	import mx.rpc.Fault;
	
	/**
	 * 日志信息
	 */
	[Bindable]
	[RemoteClass(alias="cn.skyclass.beans.LogInfoBean")]
	public class LogInfoBean extends FlexBean
	{
		// 记录错误信息
		public var errId:String;
		public var errName:String;
		public var errMessage:String;
		public var errStackTrace:String;
		
		// 记录失败信息
		public var faultCode:String;
		public var faultString:String;
		public var faultDetail:String;
		
		// 记录正常信息
		public var info:String;
		
		// 类文件名及其代码行
		public var className:String;
		public var codeLine:String;
		
		// 标识日志类型
		public var errorLog:Boolean;
		public var faultLog:Boolean;
		public var infoLog:Boolean;
		
		
		public function initByError(err:Error):void{
			this.errorLog = true;
			this.errId = err.errorID.toString();
			this.errName = err.name;
			this.errMessage = err.message;
			this.errStackTrace = err.getStackTrace();
		}
		
		public function initByFault(f:Fault):void{
			this.faultLog = true;
			this.faultCode = f.faultCode;
			this.faultString = f.faultString;
			this.faultDetail = f.faultDetail;
		}
		
		public function initByInfo(info:String):void{
			this.infoLog = true;
			this.info = info;
		}
		
	}
}